package com.my.blog.website.service.impl;

import com.my.blog.website.dao.RoadVoMapper;
import com.my.blog.website.model.Vo.RoadVo;
import com.my.blog.website.model.Vo.RoadVoExample;
import com.my.blog.website.service.IRoadService;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoadServiceImpl implements IRoadService {
    @Resource
    private RoadVoMapper roadDao;
    @Override
    public PageInfo<RoadVo> getRoadsByPage(RoadVoExample roadVoExample,int page,int limit) {
        PageHelper.startPage(page, limit);
        return new PageInfo<>(roadDao.selectRoadsByPage(roadVoExample));
    }

    @Override
    public PageInfo<RoadVo> selectAllRoads() {
        return new PageInfo<>(roadDao.selectAllRoads());
    }
}
